package com.eastfair.certificate.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.certificate.enumeration.BadgeTemplateClassifyEnum;
import com.eastfair.certificate.enumeration.BadgeTemplateCertificateTypeEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 证件模块
 * </p>
 *
 * @author ligang
 * @since 2023-06-09
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cert_badge_template")
@ApiModel(value = "BadgeTemplate", description = "证件模块")
@AllArgsConstructor
public class BadgeTemplate extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会id")
    private Long exhibitionId;

    /**
     * 证件分类:#{ARRANGE:布展证;MOVEOUT:撤展证;}
     */
    @ApiModelProperty(value = "证件分类:#{ARRANGE:布展证;MOVEOUT:撤展证;}")
    @TableField(value = "classify")
    @Excel(name = "证件分类:#{ARRANGE:布展证;MOVEOUT:撤展证;}", replace = {"布展证_ARRANGE", "撤展证_MOVEOUT",  "_null"})
    private BadgeTemplateClassifyEnum classify;

    /**
     * 证件id
     */
    @ApiModelProperty(value = "证件id")
    @TableField(value = "certificate_id")
    @Excel(name = "证件id")
    private Long certificateId;

    /**
     * 模板名称
     */
    @ApiModelProperty(value = "模板名称")
    @Size(max = 100, message = "模板名称长度不能超过100")
    @TableField(value = "template_name", condition = LIKE)
    @Excel(name = "模板名称")
    private String templateName;

    /**
     * 胸卡宽
     */
    @ApiModelProperty(value = "胸卡宽")
    @TableField(value = "wide")
    @Excel(name = "胸卡宽")
    private Integer wide;

    /**
     * 胸卡高
     */
    @ApiModelProperty(value = "胸卡高")
    @TableField(value = "high")
    @Excel(name = "胸卡高")
    private Integer high;

    /**
     * 中文字体
     */
    @ApiModelProperty(value = "中文字体")
    @Size(max = 255, message = "中文字体长度不能超过255")
    @TableField(value = "typeface", condition = LIKE)
    @Excel(name = "中文字体")
    private String typeface;

    /**
     * 英文字体
     */
    @ApiModelProperty(value = "英文字体")
    @Size(max = 255, message = "英文字体长度不能超过255")
    @TableField(value = "en_typeface", condition = LIKE)
    @Excel(name = "英文字体")
    private String enTypeface;

    /**
     * 底图地址
     */
    @ApiModelProperty(value = "底图地址")
    @Size(max = 255, message = "底图地址长度不能超过255")
    @TableField(value = "base_map_img", condition = LIKE)
    @Excel(name = "底图地址")
    private String baseMapImg;

    /**
     * 样式内容
     */
    @ApiModelProperty(value = "样式内容")

    @TableField(value = "style_txt", condition = LIKE)
    @Excel(name = "样式内容")
    private String styleTxt;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 是否可用，1是；0否
     */
    @ApiModelProperty(value = "是否可用，1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否可用，1是；0否")
    private Integer isEnabled;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 团队id
     */
    @ApiModelProperty(value = "团队id")
    @TableField(value = "team_id")
    @Excel(name = "团队id")
    private Long teamId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 证件类型:#{CAR:车证;PEOPLE:人证;POWER:机力车证;}
     */
    @ApiModelProperty(value = "证件类型:#{CAR:车证;PEOPLE:人证;POWER:机力车证;}")
    @TableField(value = "certificate_type")
    @Excel(name = "证件类型:#{CAR:车证;PEOPLE:人证;POWER:机力车证;}", replace = {"车证_CAR", "人证_PEOPLE", "机力车证_POWER",  "_null"})
    private BadgeTemplateCertificateTypeEnum certificateType;


    @Builder
    public BadgeTemplate(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long exhibitionId, BadgeTemplateClassifyEnum classify, Long certificateId, String templateName, Integer wide, 
                    Integer high, String typeface, String enTypeface, String baseMapImg, String styleTxt, Integer isDeleted, 
                    Integer isEnabled, Long tenantId, Long projectId, Long teamId, Long subsystemId, BadgeTemplateCertificateTypeEnum certificateType) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.exhibitionId = exhibitionId;
        this.classify = classify;
        this.certificateId = certificateId;
        this.templateName = templateName;
        this.wide = wide;
        this.high = high;
        this.typeface = typeface;
        this.enTypeface = enTypeface;
        this.baseMapImg = baseMapImg;
        this.styleTxt = styleTxt;
        this.isDeleted = isDeleted;
        this.isEnabled = isEnabled;
        this.tenantId = tenantId;
        this.projectId = projectId;
        this.teamId = teamId;
        this.subsystemId = subsystemId;
        this.certificateType = certificateType;
    }

}
